import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/api/video/list',
    method: 'get',
    params: query
  })
}

export function fetchVideo(id) {
  return request({
    url: '/api/video/detail',
    method: 'get',
    params: { id }
  })
}

export function fetchVideoOptions() {
  return request({
    url: '/api/video/list-all-options',
    method: 'get'
  })
}

export function createVideo(data) {
  return request({
    url: '/api/video/create',
    method: 'post',
    data
  })
}

export function updateVideo(data) {
  return request({
    url: '/api/video/update',
    method: 'post',
    data
  })
}

export function deleteVideo(data) {
  return request({
    url: '/api/video/delete',
    method: 'post',
    data
  })
}

export function batchUpdateVideo(data) {
  return request({
    url: '/api/video/batch-update',
    method: 'post',
    data
  })
}

export function fetchVideoTypeList(query) {
  return request({
    url: '/api/videotype/list',
    method: 'get',
    params: query
  })
}
